load "libui.ring"

todoWindow = uiNewWindow("todo", 235, 303, True)
uiWindowOnClosing(todoWindow,"closeApp()")
// 顶部输入
taskInput = uiNewEntry()
btn_add = uiNewButton("添加")
hbox = uiNewHorizontalBox()
vbox = uiNewVerticalBox() 
uiBoxAppend(hbox,taskInput,0)
uiBoxAppend(hbox,btn_add,0)
uiBoxAppend(vbox,hbox,0)

//uinewscrollingarea()
//scroll = uiNewScrollView()
//uiBoxAppend(vbox,scroll,0)
//uiScrollViewSetChild(scroll,vbox)
uiWindowSetChild(todoWindow,vbox)
uiButtonOnClicked(btn_add,"add_task()")
uiControlShow( todoWindow )
uiMain()
func closeApp()
  uiQuit()
func add_task()
  task = uiEntryText(taskInput)
  uiBoxAppend(vbox,uiNewLabel(task),0)